#include "book.h"

int main()
{
	printf("**********************\n");
	printf("**大学图书馆管理系统**\n");
	printf("**********************\n");
	printf("*****请选择功能*******\n");
	printf("**********************\n");
	printf("****1.书籍信息录入****\n");
	printf("****2.读者信息录入****\n");
	printf("****3.借阅情况录入****\n");
	printf("****4.计算扣款金额****\n");
	printf("****5.图书信息查询****\n");
	printf("****6.管理员的信息****\n");
	printf("****7.书籍的剩余量****\n");
	printf("****8.结束        ****");
	
	int i;
	
	scanf("%d", &i);
	
	int x;
	int y;
	
	Book book[100];
	Reader reader[100];
	Librarian librarian[100];
	Borrow borrow[100];
		
	switch (i)
	{
		case 1:
			
			printf("请输入录入书籍个数");
		
    		scanf("%d", &x);
    	
    		printf("请输入书籍的书名，作者，数量");
    		
    		InputB(book, x);
		
			break;
		case 2:
		
			printf("请输入录入读者个数");
		
    		scanf("%d", &y);
    	
    		printf("请输入读者姓名，性别，年龄，编号");
    	
    		InputR(reader, y);
	
			break;
			
		case 3:
			
			printf("请输入几号读者借阅了什么书籍");
			
		case 4:
	
			printf("请输入您的编号");
		
		case 5:
	
			printf("请输入您查询书籍的名称");
			
			FILE *fp;
			
			int i;
			
			Book book[3];
		
    		fp = fopen("/test/", "rb");

		    while(fread(&book[i], sizeof(book), 1, fp) == 1)
	    	{
    	    	printf("%s %s %d\n", book[i].title,book[i].author, book[i].num);
        		i++;	
    		}

			fclose(fp);
	
		case 6:
	
			printf("请输入管理员编号");
			
		case 7:
			
			printf("请输入查阅书籍名称");
			scanf("%s",&book[i].title);
			OutputB(book, x);
		
		case 8:
	
			printf("老铁，下次再来");
	
		default:

			printf("错误了，老铁，你看看你选的什么，重新选择吧");
	}
	return 0;
}